<template>
    <div>
        <el-card class="box-card">
            <el-table
                    :data="tableData"
                    border
                    style="width: 100%">
                <el-table-column
                        fixed
                        prop="guestId"
                        label="租户ID"
                        width="150">
                </el-table-column>
                <el-table-column
                        prop="centMonths"
                        label="租赁时长"
                        width="120">
                    <template slot-scope="scope">
                        {{scope.row.centMonths}}个月
                    </template>
                </el-table-column>
                <el-table-column
                        prop="houseId"
                        label="房屋ID"
                        width="120">
                </el-table-column>
                <el-table-column
                        prop="monthPrice"
                        label="月租"
                        width="120">
                </el-table-column>
                <el-table-column
                        prop="rentType"
                        label="租赁类型"t
                        width="120">
                    <template slot-scope="scope">
                        <el-tag type="success"t>{{scope.row.rentType === 1? "整租" : "合租"}}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column
                        prop="totalPrice"
                        label="总金额"
                        width="120">
                    <template slot-scope="scope">
                        {{scope.row.totalPrice}}元
                    </template>
                </el-table-column>
                <el-table-column
                        prop="effectTime"
                        label="时间"
                        width="120">
                </el-table-column>
            </el-table>
<!--                <el-table-column-->
<!--                        fixed="right"-->
<!--                        label="操作"-->
<!--                        width="100">-->
<!--                    <template slot-scope="scope">-->
<!--                        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>-->
<!--                        <el-button type="text" size="small">编辑</el-button>-->
<!--                    </template>-->
<!--                </el-table-column>-->

        </el-card>
    </div>
</template>

<script>
    export default {
        name: "OrderManage",
        data() {
            return {
                tableData: [{
                    date: '2016-05-02',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1518 弄',
                    zip: 200333
                }, {
                    date: '2016-05-04',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1517 弄',
                    zip: 200333
                }, {
                    date: '2016-05-01',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1519 弄',
                    zip: 200333
                }, {
                    date: '2016-05-03',
                    name: '王小虎',
                    province: '上海',
                    city: '普陀区',
                    address: '上海市普陀区金沙江路 1516 弄',
                    zip: 200333
                }]
            }
        },
        created() {
            const _this = this
            const hostId = localStorage.getItem("userId")
            _this.$http.get('/letterIntent/selectLetterIntent/' + hostId).then(function (resp) {
                console.log(resp)
                if (resp.data.code === 201)
                {
                    _this.tableData = resp.data.data
                }
            })
        },
        methods: {
            handleClick: function (e) {
                console.log(e)
            }
        }
    }
</script>

<style scoped>
    .text {
        font-size: 14px;
    }

    .item {
        padding: 18px 0;
    }

    .box-card {
        width: 1000px;
        height: 960px;
        text-align: center;
    }
</style>
